<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      [v-cloak] {
        display: none;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <!-- v-cloak 防止闪现：在Vue还未解析模板时，先将模板隐藏 -->
      <p v-cloak>{{ text }}</p>
      <p v-text="text"></p>
      <p v-html="text"></p>
      <!-- v-pre: 跳过渲染：Vue不会对元素进行解析 -->
      <p v-pre>{{ text }}</p>
      <!-- v-once: 只渲染/解析一次 -->
      <p v-once>{{ num }}</p>
      <button @click="num++">按钮</button>
    </div>
    <script src="./js/vue.js"></script>
    <script>
      const vm = new Vue({
        data: {
          text: "<span>hello</span>",
          num: 0,
        },
      });
      vm.$mount("#app");
    </script>
  </body>
</html>
